import dayjs from "dayjs";
export const mainMealList = [
  {
    type: 2,
    name: "初级套餐",
    fast: 20,
    relax: 60,
    expireTime: "",
  },
  {
    type: 3,
    name: "进阶版本",
    fast: 60,
    relax: -1,
    expireTime: "",
  },
  {
    type: 4,
    name: "尊享版本",
    fast: 150,
    relax: -1,
    expireTime: "",
  },
];

export const experienceMealList = [
  {
    type: 1,
    name: "体验套餐",
    fast: 2,
    relax: 40,
    timeRange: "",
    day: 5
  },
];


export const currentMealList = [
  {
    day: 30,
  },
  {
    day: 60,
  },
  {
    day: 90,
  },
];



export function getBaseMeal() {
  return [].concat(experienceMealList, mainMealList);
}

export function getAllMeal() {
  const now = dayjs();
  const list = []
  currentMealList.forEach(v => {
    for (const item of mainMealList) {
      const obj = {
        ...item,
        day: v.day,
        name: `(${v.day})天${item.name}`, // `v.day天共享${item.name}
        expireTime: now.add(v.day, "day").format("YYYY-MM-DD HH:mm:ss"),
      }
      list.push(obj)
    }
  })
  experienceMealList.forEach(v => {
    list.unshift({
      ...v,
      day: v.day,
      name: `(${v.day})天${v.name}`, // `v.day天共享${item.name}
      expireTime: now.add(v.day, "day").format("YYYY-MM-DD HH:mm:ss"),
    })
  })
  return list
}